
const puppeteer = require('puppeteer');
const path = require('path');
const fs = require('fs');
const unirest = require('unirest');
const fetchLogic = require('./fetchLogic')

const link = 'http://www.dianping.com/'

const processTask = (tasks) => {

  if (tasks && tasks.length > 0) {
    // for (let task of tasks) {
    //   task.shopUrl = `http://www.dianping.com/shop/${task.shopId}`;
    //
    // }
    fetchLogic(tasks)      
  }
}



process.on('message', (msg) => {
  processTask(msg)
})


